-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement docker configuration for mita #167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can follow the project layout from https://github.com/golang-standards/project-layout/tree/master/deployments and move the files to deployments/docker/mita-amd64
directory.
@@ -0,0 +1,16 @@ | |||
services: | |||
meiru: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
service, image and container_name should be mita
|
||
RUN go mod tidy | ||
|
||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GOCC=musl-gcc go build -ldflags="-s -w" -o mita cmd/mita/mita.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GOCC=musl-gcc
have no effect and should be removed, because we have CGO_ENABLED=0
, which means there is no C compiler needed and C library linked. Please help to check if the program still runs after it is removed.
|
||
WORKDIR /build | ||
|
||
RUN go mod tidy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step is not needed. The source code already guarantees the modules are tidy.
No description provided.